package com.imooc.api.controller.admin;

import com.imooc.grace.result.GraceJSONResult;
import com.imooc.pojo.bo.AdminLoginBO;
import com.imooc.pojo.bo.NewAdminBO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 管理员admin维护
 */
@RequestMapping("adminMng")
public interface AdminMngControllerApi {

    /**
     * 管理员登录
     */
    @PostMapping("/adminLogin")
    GraceJSONResult adminLogin(@RequestBody AdminLoginBO adminLoginBO, HttpServletResponse response);

    /**
     * 查询admin用户名是否存在
     */
    @PostMapping("/adminIsExist")
    GraceJSONResult adminIsExist(@RequestParam String username);

    /**
     * 创建admin
     */
    @PostMapping("/addNewAdmin")
    GraceJSONResult addNewAdmin(@RequestBody NewAdminBO newAdminBO, HttpServletResponse response);

    /**
     * 查询admin列表
     */
    @PostMapping("/getAdminList")
    GraceJSONResult getAdminList(@RequestParam Integer page, @RequestParam Integer pageSize);

    /**
     * admin退出登录
     */
    @PostMapping("/adminLogout")
    GraceJSONResult adminLogout(@RequestParam String adminId, HttpServletRequest request, HttpServletResponse response);

    /**
     * admin管理员的人脸登录
     */
    @PostMapping("/adminFaceLogin")
    GraceJSONResult adminFaceLogin(@RequestBody AdminLoginBO adminLoginBO, HttpServletRequest request, HttpServletResponse response);

}
